﻿Import-Module -Force -Name .\libWindowsRDS.psm1
Import-Module -Force -Name ..\ConfigurationDatabase\libConfigurationDatabase.psm1
Import-Module -Force -Name ..\BuildDeployment\libUtilities.psm1

$scriptEnvironment="QA6"

if($null -eq $credential -or $credential -eq "")
{
    $userName=(Get-ConfigurationSetting -environmentShortName $scriptEnvironment -scope Global -name "AutomationCredentialUserName").Value
    $password=(Get-ConfigurationSetting -environmentShortName $scriptEnvironment -scope Global -name "AutomationCredentialPassword").Value
    $credential=Get-CredentialsFromPlainText -userName $userName -password $password
}

$brokerComputerName=Get-Content .\RDSBrokers.txt

Get-RDSPerfmonStatistics -brokerComputerName $brokerComputerName -credential $credential -refreshIntervalSeconds 1800 -outputType Stream | Out-Null